package com.ruoyi.mall.sms.service.impl;

import com.ruoyi.mall.sms.domain.SmsCouponProductRelation;
import com.ruoyi.mall.sms.mapper.SmsCouponProductRelationMapper;
import com.ruoyi.mall.sms.service.ISmsCouponProductRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 优惠券和产品的关系Service业务层处理
 *
 * @author xuxing
 * @date 2021-02-12
 */
@Service
public class SmsCouponProductRelationServiceImpl implements ISmsCouponProductRelationService
{
    @Autowired
    private SmsCouponProductRelationMapper smsCouponProductRelationMapper;

    /**
     * 查询优惠券和产品的关系
     *
     * @param id 优惠券和产品的关系ID
     * @return 优惠券和产品的关系
     */
    @Override
    public SmsCouponProductRelation selectSmsCouponProductRelationById(Long id)
    {
        return smsCouponProductRelationMapper.selectSmsCouponProductRelationById(id);
    }

    /**
     * 查询优惠券和产品的关系列表
     *
     * @param smsCouponProductRelation 优惠券和产品的关系
     * @return 优惠券和产品的关系
     */
    @Override
    public List<SmsCouponProductRelation> selectSmsCouponProductRelationList(SmsCouponProductRelation smsCouponProductRelation)
    {
        return smsCouponProductRelationMapper.selectSmsCouponProductRelationList(smsCouponProductRelation);
    }

    /**
     * 新增优惠券和产品的关系
     *
     * @param smsCouponProductRelation 优惠券和产品的关系
     * @return 结果
     */
    @Override
    public int insertSmsCouponProductRelation(SmsCouponProductRelation smsCouponProductRelation)
    {
        return smsCouponProductRelationMapper.insertSmsCouponProductRelation(smsCouponProductRelation);
    }

    /**
     * 修改优惠券和产品的关系
     *
     * @param smsCouponProductRelation 优惠券和产品的关系
     * @return 结果
     */
    @Override
    public int updateSmsCouponProductRelation(SmsCouponProductRelation smsCouponProductRelation)
    {
        return smsCouponProductRelationMapper.updateSmsCouponProductRelation(smsCouponProductRelation);
    }

    /**
     * 批量删除优惠券和产品的关系
     *
     * @param ids 需要删除的优惠券和产品的关系ID
     * @return 结果
     */
    @Override
    public int deleteSmsCouponProductRelationByIds(Long[] ids)
    {
        return smsCouponProductRelationMapper.deleteSmsCouponProductRelationByIds(ids);
    }

    /**
     * 删除优惠券和产品的关系信息
     *
     * @param id 优惠券和产品的关系ID
     * @return 结果
     */
    @Override
    public int deleteSmsCouponProductRelationById(Long id)
    {
        return smsCouponProductRelationMapper.deleteSmsCouponProductRelationById(id);
    }
}
